﻿using System;

namespace XTengine.ComponentModel
{
    public class Int64Converter : TypeConverter<Int64>
    {
        public override Int64 ConvertFrom(string value)
        {
            Int64 result;
            if (Int64.TryParse(value, out result))
            {
                return result;
            }

            return 0;
        }

        public override string ConvertTo(Int64 value)
        {
            return value.ToString();
        }
    }
}